<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateRbacMenuTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('rbac_menu', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name',60)->comment('菜单名称');
            $table->unsignedBigInteger('parent_id',false)->default(0)->comment('父id');
            $table->string('route_name',60)->nullable()->comment('路由名称');
            $table->string('query_params',120)->nullable()->comment('参数');
            $table->string('type','15')->nullable()->comment('类型');
            $table->integer('lft')->nullable()->comment('左边索引值');
            $table->integer('rgt')->nullable()->comment('右边索引值');
            $table->integer('depth')->nullable()->comment('层级深度');
            $table->string('icon',120)->nullable()->comment('图标');
            $table->timestamps();
            $table->softDeletes();
            $table->engine="InnoDb";
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('rbac_menu');
    }
}
